#include "BaseElement.h"
#include "math.h"

point Tri::pCenter() {
	point P = (m_p0 + m_p1 + m_p2) / 3;
	return P;
}
Tri Tri::changeTri(double& c) {
	point P = this->pCenter();
	point p0 = P+(m_p0-P) * c;
	point p1 = P+(m_p1 - P) * c;
	point p2 = P+(m_p2 - P) * c;
	return Tri(p0, p1, p2);
}
Tri Tri::RotateTri(double& angel) {
	point pCenter = this->pCenter();
	point p0 = Rotate_Point(m_p0, pCenter, angel);
	point p1 = Rotate_Point(m_p1, pCenter, angel);
	point p2 = Rotate_Point(m_p2, pCenter, angel);
	return Tri(p0, p1, p2);
}